https:/​/​rest.course-source.net/​enrol/​key/​{LoginID}/​{Key}

POST

Enrol a user on a course using an enrolment key

Use POST /enrolment/​key to create enrolment key(s)

When using a key containing multiple courses a partial success is possible so check the Errors array in the data property of the response if the main error property of the response is empty.
{LoginID}
{Key}

Response